package cn.kgc.article.controller;

import cn.kgc.article.service.CategoryService;
import cn.kgc.common.entity.Category;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by teacher ZHANG on 2023/2/2
 */
@RestController
public class CategoryController {
    @Autowired
    private CategoryService categoryService;

    @GetMapping("/categories")
    public List<Category> listCategories(){
        return categoryService.list();
    }

    //...增删改
}
